package system;

import java.net.URL;

import javax.xml.namespace.QName;
import javax.xml.soap.SOAPMessage;
import javax.xml.ws.Dispatch;
import javax.xml.ws.Service;

public class Analytics {
    public Analytics() {
        super();
    }

    public static void main(String[] args) {
        Analytics analytics = new Analytics();
        try {
            QName serviceName =
                new QName("http://www.bea.com/analytics/AnalyticsQueryService",
                          "AnalyticsQueryService");

            URL serviceURL =
                new URL("http://analytics:11944/analytics/QueryService?wsdl");

            Service service = Service.create(serviceURL, serviceName);

            QName portName =
                new QName("http://www.bea.com/analytics/AnalyticsQueryService",
                          "AnalyticsQueryServicePort");

            Dispatch<SOAPMessage> dispatch =
                service.createDispatch(portName, SOAPMessage.class,
                                       Service.Mode.MESSAGE);
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}
